//
//  myCollectionViewCell.m
//  JhPageItemView
//
//  Created by 张敬 on 2019/7/17.
//  Copyright © 2019年 Jh. All rights reserved.
//

#import "JhCollectionViewCell.h"

@implementation JhCollectionViewCell

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self)
    {
        CGFloat width = self.frame.size.width;
        self.topImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, width, width)];
        self.topImage.image = [UIImage imageNamed:@"meat_list"];
        
        [self addShadowAndCircleCorner:self.topImage.layer corner:8];
        [self.contentView addSubview:self.topImage];
        
        
        self.btmlabel = [[UILabel alloc] initWithFrame:CGRectMake(0, self.topImage.bottom + 6, width, 17)];
        self.btmlabel.textAlignment = NSTextAlignmentCenter;
        self.btmlabel.textColor = UIColorFromRGB(0x262626);
        self.btmlabel.font = mMediumFont(12);
        [self.contentView addSubview:self.btmlabel];
    }
    
    return self;
}

- (void)setModel:(BuyMeatPartModel *)model{
    [_topImage sd_setImageWithURL:[NSURL URLWithString:model.headImg] placeholderImage:[UIImage imageNamed:@"placeholder_small"]];
    _btmlabel.text = model.positionName;
}

@end
